package cn.stylefeng.guns.modular.weixin.service.impl;

import cn.stylefeng.guns.modular.weixin.api.Utils;
import cn.stylefeng.guns.modular.weixin.entity.Profile;
import cn.stylefeng.guns.modular.weixin.mapper.WeiXinOrderMapper;
import cn.stylefeng.guns.modular.weixin.service.WeiXinOrderService;
import cn.stylefeng.guns.sys.modular.tao.entity.WxUser;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;



@Service("weiXinOrderService")
public class WeiXinOrderImpl  implements WeiXinOrderService {

     @Autowired
     private WeiXinOrderMapper weiXinOrderMapper;

    @Override
    public List<HashMap<String, String>> selectWeixinOrder(HashMap<String, String> map) {


        return weiXinOrderMapper.selectWeixinOrder(map) ;
    }


    @Override
    public List<HashMap<String, String>> WeiUser(WxUser wx) {
        HashMap<String, Object> map= new HashMap<>();
        map.put("weiUser",wx);
        return weiXinOrderMapper.WeiUser(map);
    }

    @Override
    public void zhuce(WxUser wx) {
        HashMap<String, Object> map= new HashMap<>();
        map.put("wu",wx);
        weiXinOrderMapper.zhuce(map);
    }

    @Override
    public void addProfile(Profile profile) {
        weiXinOrderMapper.addProfile(profile);
    }

    @Override
    public void updateProfile(Profile profile) {
        weiXinOrderMapper.updateProfile(profile);
    }

    @Override
    public  List<HashMap<String,Object>>
    selectProfile(Profile profile) {
        return weiXinOrderMapper.selectProfile(profile);
    }

    @Override
    public void deleteProfile(Profile profile) {
        weiXinOrderMapper.deleteProfile(profile);
    }

    @Override
    public void updateWxUser(WxUser wx) {
        weiXinOrderMapper.updateWxUser(wx);
    }


    /**
     * 查询 openid 是否存在
     */
    @Override
    public int queryUser( String openid){
        return weiXinOrderMapper.queryUser(openid);
    }

    @Override
    public void updateAdressByFalse(Profile profile) {
        weiXinOrderMapper.updateAdressByFalse(profile);
    }


}
